package com.icesoft.system.vo;

import com.icesoft.framework.core.binding.annotation.BindDict;
import com.icesoft.framework.core.binding.annotation.BindEntityList;
import com.icesoft.framework.core.binding.annotation.BindFieldList;
import com.icesoft.system.entity.Permission;
import com.icesoft.system.entity.Role;
import com.icesoft.system.entity.RoleMenu;
import com.icesoft.system.entity.RoleOrg;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;

import java.util.List;

@Getter
@Setter
@Accessors(chain = true)
public class RoleVO extends Role {

	@BindDict(type = "ROLE_TYPE", field = "roleType")
	private String roleTypeName;

	@BindFieldList(entity = RoleMenu.class, field = "menuId", condition = "this.id=role_id")
	private List<Long> menuIdList;

	@BindFieldList(entity = RoleOrg.class, field = "orgId", condition = "this.id=role_id")
	private List<Long> orgIdList;

	@BindEntityList(entity = Permission.class, condition = "this.id=role_id")
	private List<Permission> permissionList;
}